package com.gurid.service.edu.controller;

import com.gurid.common.base.result.R;
import org.springframework.web.bind.annotation.*;

//@CrossOrigin
@RestController
@RequestMapping("/user")
public class LoginController {

    /**
     * 登录接口
     * @return
     */
    @PostMapping("login")
    public R login(){
        return R.ok().data("token", "admin");
    }

    /**
     * 登录成功后返回用户信息
     * @return
     */
    @GetMapping("info")
    public R info(){
        return R.ok()
                .data("name", "admin")
                .data("roles", "[admin]")
                .data("avatar", "http://sc6vzb7ct.hd-bkt.clouddn.com/596455f2-2c4e-4aa6-af14-47be61a23bdd.png-gurid");
    }

    @PostMapping("logout")
    public R logout(){
        return R.ok();
    }
}
